package com.huitone.gddw.controller.system;

import java.util.List;
import java.util.Map;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.huitone.gddw.service.system.IDicDefService;

/**
 * 数据字典 控制器
 * @author wuluodan
 *
 */
@Controller
@RequestMapping(value="dicDef")
public class DicDefController {

private final static Logger LOGGER = Logger.getLogger(DicDefController.class);
	
	@Autowired
	private IDicDefService dicDefService;
	
	/**
	 * 根据字典名获取数据
	 * @param dicName 字典名
	 * @return List<Map<String, Object>>
	 */
	@ResponseBody
	@RequestMapping(value="getByDicName")
	public List<Map<String, Object>> getByDicName(String dicName) {
		try {
			List<Map<String, Object>> list = dicDefService.getByDicName(dicName);
			return list;
		} catch (Exception e) {
			LOGGER.error("查询数据字典信息出现异常：" + e.getMessage(), e);
			return null;
		}
	}
	
}
